﻿angular.module("app").factory('hatData', function() {

  var hatList = [];
  function baseHat(name, flavor, buff, unbuff) {
    this.name = name;
    this.flavor = flavor;
    this.buff = buff;
    this.unbuff = unbuff;
    this.prebuff = [];
    hatList.push(this);
  }

  var wizard = baseHat("Wizard", "Now I'm a...wait.",
    function(djinni) {
      prebuff.push(djinni.clickMulti);
      djinni.clickMulti += 3;
    },
    function(djinni) {
      djinni.clickMulti = prebuff[0];
    });

  var catInTheHat = baseHat("Cat in the Hat", "How now brown cow?",
    function(djinni) {
      prebuff.push(djinni.click);
      djinni.click += 10;
    },
    function(djinni) {
      djinni.click = prebuff[0];
    });

  var catInThe = baseHat("Cat in the", "Buy hat get cat free.",
    function(djinni) {
      prebuff.push(djinni.base);
      djinni.base += 20;
    },
    function(djinni) {
      djinni.base = prebuff[0];
    });

  return {
    getAll: function() {
      return hatList;
    }
  }
});